//
//  LMPerson.m
//  05-九宫格
//
//  Created by apple on 15/7/22.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "LMPerson.h"

@implementation LMPerson

- (instancetype)initWithDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        self.name = dic[@"name"];
        self.icon = dic[@"icon"];
    }
    return self;
}

+ (instancetype)appWithDic:(NSDictionary *)dic
{
    return [[self alloc] initWithDic:dic];
}

+ (NSArray *)appsList
{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"app" ofType:@"plist"];
    
    NSArray *array  = [NSArray arrayWithContentsOfFile:path];
    
    NSMutableArray *marray = [NSMutableArray array];
    for (NSDictionary *dic in array) {
        
        [marray addObject:[self appWithDic:dic]];
        
    }
    return marray;

}
@end
